package com.example.designpatterns.behavioral.iterator;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        Object[] elements = {"A", "B", "C", "D", "E"};
        Collection collection = new ConcreteCollection(elements);
        Iterator iterator = collection.createIterator();

        while (iterator.hasNext()) {
            Object element = iterator.next();
            System.out.println(element);
        }
    }

}
